package bat.ke.qq.com.aop;


import lombok.extern.slf4j.Slf4j;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * 自定义实现代理的逻辑
 */
@Slf4j
public class AopMethodInterceptor implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Long start = System.currentTimeMillis();
        Object result = invocation.proceed();
        log.info("调用时间：" + (System.currentTimeMillis() - start));
        return result;
    }
}
